<?php

namespace Modules\Admin\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Modules\Admin\Service\TemplateService;

class TemplateController extends Controller
{
    /**
     * Display a listing of the resource.
     * @return Response
     */
    public function index(TemplateService $templateService)
    {
    	//dd ($templateService->getAllTemplate ());die;
		$templates = $templateService->getAllTemplate ();
        return view('admin::template.index',compact ('templates'));
    }
	public function setDefaultTemplate($name){
    	\HDModule::saveConfig(['template' => $name],'config');
    	session ()->flash ('success','设置成功');
    	return back ();
	}


}
